package org.eenie.commonlib.ui;

import android.content.Intent;
import android.view.View;

import com.alibaba.android.arouter.launcher.ARouter;
import com.eenie.common.base.BaseActivity;
import com.eenie.common.base.WinMode;
import com.eenie.common.ui.x5webview.BrowserActivity;

import org.eenie.commonlib.R;
import org.eenie.commonlib.ui.arch.ExampleActivity;
import org.eenie.commonlib.ui.bento.BentoActivity;
import org.eenie.commonlib.ui.flutter.FlutterDemoActivity;
import org.eenie.commonlib.ui.state.StateActivity;
import org.eenie.commonlib.ui.win.WinModeShowActivity;
import org.jetbrains.annotations.NotNull;


public class MainActivity extends BaseActivity {

    @Override
    public int initContentView() {
        return R.layout.activity_main;
    }

    @Override
    public void initInjector() {
        setWinMode(WinMode.IMMERSE);

    }

    @Override
    public void initUiAndListener(@NotNull View view) {


    }


    public void showWinMode(View view) {
        startActivity(new Intent(mContext, WinModeShowActivity.class));
    }

    public void lazyFragment(View view) {
        startActivity(new Intent(mContext, FlutterDemoActivity.class));
    }

    public void startBrowser(View view) {
        BrowserActivity.start(mContext, "https://aframe.io/examples/showcase/moonrider/");
    }



    public void showBento(View view) {
        ARouter.getInstance()
                .build(BentoActivity.PATH)
                .navigation();
    }

    public void showState(View view) {

        startActivity(new Intent(mContext, StateActivity.class));
    }


    public void showArch(View view) {
        startActivity(new Intent(mContext, ExampleActivity.class));
    }


//    @Override
//    public void onBackPressed() {
//        new QMUIDialog.MessageDialogBuilder(mContext)
//                .setTitle("提示")
//                .setMessage("退出应用？")
//                .addAction(new QMUIDialogAction("取消", new QMUIDialogAction.ActionListener() {
//                    @Override
//                    public void onClick(QMUIDialog dialog, int index) {
//                        dialog.dismiss();
//                    }
//                }))
//                .addAction(new QMUIDialogAction("确定", new QMUIDialogAction.ActionListener() {
//                    @Override
//                    public void onClick(QMUIDialog dialog, int index) {
//                        dialog.dismiss();
//                        finish();
//                    }
//                }))
//                .create()
//                .show();
//    }
}
